package nancal.mp.db.mongo.entity.dev

import nancal.mp.db.mongo.EditorLocationEnum
import nancal.mp.db.mongo.JenkinsLanguageEnum
import nbcp.base.db.IdName
import nbcp.base.db.annotation.Cn
import nbcp.base.db.annotation.DbEntityGroup
import nbcp.base.model.BaseMarkEntity
import org.springframework.data.mongodb.core.mapping.Document


data class EditorData(
    var txtStart: String = "",
    var txt1: String = "",
    var txt2: String = "",
    var txt3: String = "",
    var txtEnd: String = "",
    var matchLines:MutableList<Int> = mutableListOf(),
    var location: EditorLocationEnum = EditorLocationEnum.ReplaceWord,
    //要替换的内容。仅当 location == Replace有效。
    var replace: String = "",
    var content: String = ""
)

@Document
@DbEntityGroup("dev")
data class UserDockerfile(
    var name: String = "",
    var language: JenkinsLanguageEnum = JenkinsLanguageEnum.Java,
    var languageVersion: String = "",
    var templateContent: String = "",
    var editors: MutableList<EditorData> = mutableListOf(),
    var dockerfile: String = "",
    @Cn("备注") var remark: String = "",
    var createBy: IdName = IdName()
) : BaseMarkEntity()